package com.suray.wcs.service.wmsconnect;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.Date;

public class WmsResponses {

    /**
     * returnStatus : 0成功 1失败
     * returnInfo : 失败原因
     * msgTime  : 2020-07-14 02:51:33.379
     */

    private Integer returnStatus;
    private String returnInfo;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss.SSS")
    private Date msgTime;

    public WmsResponses(Integer returnStatus, Date msgTime) {
        this.returnStatus = returnStatus;
        this.msgTime = msgTime;
    }

    public WmsResponses(Integer returnStatus, String returnInfo, Date msgTime) {
        this.returnStatus = returnStatus;
        this.returnInfo = returnInfo;
        this.msgTime = msgTime;
    }

    public static WmsResponses returnError(String returnInfo) {
        return new WmsResponses(1, returnInfo, new Date());
    }

    public static WmsResponses returnError(int returnStatus, String returnInfo) {
        return new WmsResponses(returnStatus, returnInfo, new Date());
    }

    public static WmsResponses returnSuccess() {
        return new WmsResponses(0, new Date());
    }

    public static WmsResponses returnSuccess(String returnInfo) {
        return new WmsResponses(0, returnInfo, new Date());
    }

    public Integer getReturnStatus() {
        return returnStatus;
    }

    public void setReturnStatus(Integer returnStatus) {
        this.returnStatus = returnStatus;
    }

    public String getReturnInfo() {
        return returnInfo;
    }

    public void setReturnInfo(String returnInfo) {
        this.returnInfo = returnInfo;
    }

    public Date getMsgTime() {
        return msgTime;
    }

    public void setMsgTime(Date msgTime) {
        this.msgTime = msgTime;
    }
}
